﻿Imports clases
Public Class frmModificar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If txtEnunciadoActual.Text = "" Then
            MessageBox.Show("Escribe enunciado actual")
            txtEnunciadoModif.Text = ""
            chkModif.Checked = False
            Exit Sub
        End If
        If txtEnunciadoModif.Text = "" Then
            MessageBox.Show("Escribe enunciado modificado")
            txtEnunciadoActual.Text = ""
            chkModif.Checked = False
            Exit Sub
        End If



        Dim sinoNue As Boolean
        If chkModif.Checked = True Then
            sinoNue = True
        Else
            sinoNue = False

        End If
        Dim mens As String = frm.miTest.Modificar(New Pregunta(txtEnunciadoActual.Text, True), New Pregunta(txtEnunciadoModif.Text, sinoNue))
        If mens <> "" Then
            MessageBox.Show(mens)
            txtEnunciadoActual.Text = ""
            txtEnunciadoModif.Text = ""
            chkModif.Checked = False
            Exit Sub
        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()

    End Sub
End Class